import io
import os
import shutil

#shutil.copyfile("e:/source/calctree/binary_tree.py","e:/source/binary_tree.py")
def copyfile(src:str,des:str):
    with open(src,'rb') as f:
        stat = os.fstat(f.fileno())
        count = 0
        with open(des,"wb") as f2:
            buf = None
            while buf is None or len(buf)==1024*1024:
                buf = f.read(1024*1024)
                count += 1024*1024
                f2.write(buf)
                print("%.2f%%"%(100*count/stat.st_size))

copyfile("e:/VMware/vmware-vmx.dmp","e:/source/vmware-vmx.dmp")